package com.bluedog.listenter;

import com.bluedog.util.ColorUtils;
import io.papermc.paper.event.player.AsyncChatEvent;
import net.kyori.adventure.text.TextComponent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

import java.util.*;

public class ChatListener implements Listener {

    @EventHandler
    public void onChat(AsyncChatEvent event) {
        TextComponent message = (TextComponent) event.message();
        String messageContent = message.content();
        TextComponent.Builder text = ColorUtils.getTextBuilderWithColors(messageContent, "#FFFFFF");
        event.message(text.build());
    }

}
